
package cn.nubia.admin.application.bean;

import cn.nubia.admin.common.mybatis.annotations.Column;
import cn.nubia.admin.common.mybatis.annotations.Id;
import cn.nubia.admin.common.mybatis.annotations.Table;
import cn.nubia.admin.common.mybatis.annotations.UnColumn;
import org.hibernate.validator.constraints.NotEmpty;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

/**
 * Created by justin on 15/6/30.
 * CREATE TABLE `nb_search_general` (
 `general_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '推广id',
 `general_word` varchar(100) DEFAULT NULL COMMENT '推广文字',
 `begin_time` int(11) DEFAULT NULL COMMENT '开始时间',
 `end_time` int(11) DEFAULT NULL COMMENT '过期时间',
 `general_type` smallint(6) DEFAULT NULL COMMENT '推广类型(0、搜索关键字；1、软
 件；2、专题；3、活动；4、外链)',
 `res_id` int(11) DEFAULT NULL COMMENT '推广资源Id',
 `link_url` varchar(200) DEFAULT NULL COMMENT '外部链接',
 `state` smallint(6) DEFAULT NULL COMMENT '状态（-1：删除，0：正常）',
 `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
 `create_admin_id` int(11) DEFAULT NULL COMMENT '创建人的管理员id',
 `create_admin_name` varchar(50) DEFAULT NULL COMMENT '创建人的管理员名称',
 `last_modify_time` int(11) DEFAULT NULL COMMENT '最后修改时间',
 `modify_admin_id` int(11) DEFAULT NULL COMMENT '修改人的管理员id',
 `modify_admin_name` varchar(50) DEFAULT NULL COMMENT '修改人的管理员名称',
 PRIMARY KEY (`general_id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='搜索推广管理';

 SET FOREIGN_KEY_CHECKS = 1;
 */
@Table(value = "nb_search_general")
public class SearchGeneral implements Serializable{


    private static final long serialVersionUID = -8244661101951482489L;

    public static final int TYPE_SEARCHWORD = 0;
    public static final int TYPE_SOFT =1;
    public static final int TYPE_TOPIC =2;
    public static final int TYPE_LINK =4;

    public static final int STATE_NORMAL =0;
    public static final int STATE_DEL = -1;

    public static final String COLUMN_STATE = "state";
    public static final String COLUMN_BEGINTIME = "beginTime";
    public static final String COLUMN_ENDTIME = "endTime";
    public static final String COLUMN_GENERALTYPE = "generalType";

    @Id(value = "general_id")
    private Integer id;//推广id
    @Column(value = "general_word")
    private String generalWord;//推广文字
    @Column(value = "begin_time")
    private Integer beginTime;
    @Column(value = "end_time")
    private Integer endTime;
    @Column(value = "general_type")
    private Integer generalType;//推广类型(0、搜索关键字；1、软件；2、专题；3、活动；4、外链)
    @Column(value = "res_id")
    private Integer resId;//推广资源Id
    @Column(value = "link_url")
    private String linkUrl;//外部链接
    @Column(value = "state")
    private Integer state;//状态（-1：删除，0：正常）
    @Column(value = "create_admin_id")
    private Integer createAdminId;//创建管理员id
    @Column(value = "create_admin_name")
    private String createAdminName;//创建人的管理员名称
    @Column(value = "modify_admin_id")
    private Integer modifyAdminId;//修改人的管理员id
    @Column(value = "modify_admin_name")
    private String modifyAdminName;//修改人的管理员名称
    @Column(value = "create_time")
    private Integer createTime;//创建时间
    @Column(value = "last_modify_time")
    private Integer lastModifyTime;//最后修改时间
    @UnColumn
    private String softradio;
    @UnColumn
    private String topicradio;
    @UnColumn
    private Date beginDate;
    @UnColumn
    private Date endDate;
    @UnColumn
    private String beginTimeShow;
    @UnColumn
    private String endTimeShow;
    @UnColumn
    private String generalTypeShow;

    public static Map<String,String> generalTypes = new TreeMap<>();
    static {
        generalTypes.put("0","搜索关键字");
        generalTypes.put("1","软件");
        generalTypes.put("2","专题");
        generalTypes.put("4","外链");
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getGeneralWord() {
        return generalWord;
    }

    public void setGeneralWord(String generalWord) {
        this.generalWord = generalWord;
    }

    public Integer getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Integer beginTime) {
        this.beginTime = beginTime;
    }

    public Integer getEndTime() {
        return endTime;
    }

    public void setEndTime(Integer endTime) {
        this.endTime = endTime;
    }

    public Integer getGeneralType() {
        return generalType;
    }

    public void setGeneralType(Integer generalType) {
        this.generalType = generalType;
    }

    public Integer getResId() {
        return resId;
    }

    public void setResId(Integer resId) {
        this.resId = resId;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getCreateAdminId() {
        return createAdminId;
    }

    public void setCreateAdminId(Integer createAdminId) {
        this.createAdminId = createAdminId;
    }

    public String getCreateAdminName() {
        return createAdminName;
    }

    public void setCreateAdminName(String createAdminName) {
        this.createAdminName = createAdminName;
    }

    public Integer getModifyAdminId() {
        return modifyAdminId;
    }

    public void setModifyAdminId(Integer modifyAdminId) {
        this.modifyAdminId = modifyAdminId;
    }

    public String getModifyAdminName() {
        return modifyAdminName;
    }

    public void setModifyAdminName(String modifyAdminName) {
        this.modifyAdminName = modifyAdminName;
    }

    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    public Integer getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Integer lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public String getSoftradio() {
        return softradio;
    }

    public void setSoftradio(String softradio) {
        this.softradio = softradio;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getTopicradio() {
        return topicradio;
    }

    public void setTopicradio(String topicradio) {
        this.topicradio = topicradio;
    }

    public String getBeginTimeShow() {
        return beginTimeShow;
    }

    public void setBeginTimeShow(String beginTimeShow) {
        this.beginTimeShow = beginTimeShow;
    }

    public String getEndTimeShow() {
        return endTimeShow;
    }

    public void setEndTimeShow(String endTimeShow) {
        this.endTimeShow = endTimeShow;
    }

    public String getGeneralTypeShow() {
        return generalTypeShow;
    }

    public void setGeneralTypeShow(String generalTypeShow) {
        this.generalTypeShow = generalTypeShow;
    }
}
